﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Lab9_Mailling.Default" %>

<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script language="javascript" type="text/javascript">
        function checkValidation() {
            var mail_to = document.getElementById("txtTo").value;
            var mail_from = document.getElementById("txtFrom").value;
            var mail_subject = document.getElementById("txtSubject").value;
            var mail_content = document.getElementById("CKEditor1").value;
            if (mail_to == "") {
                alert("Chưa nhập Email Đến...");
                return;
            }
            if (mail_from == "") {
                alert("Chưa nhập Email Gửi...");
                return;
            }
            if (mail_subject == "") {
                alert("Chưa nhập Tiêu Đề mail...");
                return;
            }
            if (mail_content == "") {
                alert("Chưa nhập Nội Dung mail...");
                return;
            }

        }
    </script>

</head>
<style type="text/css">
    #txtBody
    {
        width: 441px;
        height: 67px;
    }
    .style1
    {
        height: 24px;
    }
    .style2
    {
        font-size: xx-large;
    }
</style>

<body>
    <form id="frm" runat="server">
    <div>
        <table>
            <tr>
                <td class="style1" colspan="2">
                    <strong><span class="style2">Bài Tập 9 - Gửi Mail</span></strong>
                    <asp:Label ID="lblError" runat="server" Text="" name="lblError" Width="100%"
                style="background-color: #FF3300; font-weight: 700; color: #FFFF00;"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="text-align: left">
                    &nbsp; Email To
                </td>
                <td>
                    &nbsp;
                    <input id="txtTo" runat="server" type="text" style="width:100%"/><br />
                    <i>Cho phép gửi nhiều Email cùng lúc, mỗi email cách nhau dấu chấm phẩy ";" hoặc dấu phẩy ","</i>
                </td>
            </tr>
            <tr>
                <td style="text-align: left">
                    &nbsp; Email From
                </td>
                <td>
                    &nbsp;
                    <input id="txtFrom" runat="server" type="text" style="width:100%"/>
                </td>
            </tr>
            <tr>
                <td style="text-align: left">
                    Subject
                </td>
                <td>
                    &nbsp;
                    <input id="txtSubject" runat="server" type="text" style="width:100%"/>
                </td>
            </tr>
            <tr>
                <td style="text-align: left; vertical-align:text-top">
                    Content Mail
                </td>
                <td>
                    &nbsp;
                    <CKEditor:CKEditorControl ID="CKEditor1" runat="server" Height="200" Width="100%"></CKEditor:CKEditorControl>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    &nbsp;
                    <asp:Button ID="cmdSubmit" runat="server" Text="Send" onclick="cmdSubmit_Click"/>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
